/**
 * @Project HGEMS
 * @Author Tran Manh Hung
 * @Email: hungtmit@gmail.com | tmh@xwebgate.com
 * @Copyright © 2010 TMH. All rights reserved
 * @Createdate Oct 7, 2010
 * @Createtime 1:14:07 AM
 */


package services
{
	import mx.collections.XMLListCollection;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.http.mxml.HTTPService;


	public class MenuBarService extends HTTPService
	{

		[Bindable]
		public var menuItems:XMLList;

		public function MenuBarService(rootURL:String = null, destination:String = null)
		{
			super(rootURL, destination);
			this.resultFormat = "e4x";
			this.url = "assets/xmls/hgMenuBar.xml";

			addEventListener(ResultEvent.RESULT, resultHandler);
		}

		protected function resultHandler(event:ResultEvent):void
		{
			menuItems = new XMLList(event.result.menuitem);
		}
	}
}